const { Schema } = require('./config')
const ObjectId = Schema.Types.ObjectId
const CourseSchema = new Schema(
  {
    courseName: String,
    teacher: {
      type: ObjectId,
      ref: 'users'
    },
    students: [{ type: ObjectId, ref: 'users' }],
    status: { type: Number, default: 0 },
    remark: String,
    credit: Number
  },
  { versionKey: false }
)

module.exports = CourseSchema
